/* Online Appendix */

//Place file in working directory

/* 1. Summary Statistics */
/* Sudan Summary Statistics*/
use SudanCEM

sort ArabSpring

by ArabSpring: eststo: estpost summarize Freeriding CritGov2 GovPer TrustGov GovCorruption GovDoesAllItCan CurrentEcon FutureEcon GovSatisfaction DemocraticSupport Rural lnincome  Age Female Education CoverExpenses Married Employed Religious InternetUse if imp==0, listwise
esttab using SBTable2.tex, cells("mean sd min max") compress

eststo clear

save, replace

/* Lebanon Summary Statistics*/
use LebCEM

sort ArabSpring

by ArabSpring: eststo: estpost summarize Freeriding CritGov2 GovPerLeb TrustGov GovCorruption GovDoesAllItCan CurrentEcon FutureEcon GovSatisfaction DemocraticSupport Rural lnincome  Age Education CoverExpenses Married Employed Religious InternetUse if imp==0, listwise
esttab using SBTable3.tex, cells("mean sd min max")

eststo clear

save, replace

/* Saudi Arabia Summary Statistics*/
use SACEM

sort ArabSpring

by ArabSpring: eststo: estpost summarize Freeriding CritGov2 GovPer TrustGov GovCorruption GovDoesAllItCan CurrentEcon FutureEcon GovSatisfaction DemocraticSupport Rural lnincome  Age Female Education CoverExpenses Married Employed Religious InternetUse if imp==0, listwise
esttab using SBTable5.tex, cells("mean sd min max")

eststo clear

save, replace

/* Correlation Matrix for Social Capital */

use SudanCorr
estpost correlate CivilSociety Safety Trust, matrix listwise
esttab using SBTable6.tex, unstack not noobs compress replace

eststo clear
tetrachoric Trust CivilSociety Safety, stats(rho p)

save, replace

use LebCorr
estpost correlate CivilSociety Safety Trust, matrix listwise
esttab using SBTable7.tex, unstack not noobs compress replace

eststo clear
tetrachoric Trust CivilSociety Safety, stats(rho p)

save, replace

use SaudiCorr
estpost correlate CivilSociety Safety Trust, matrix listwise
esttab using SBTable8.tex, unstack not noobs compress replace



eststo clear
tetrachoric Trust CivilSociety Safety, stats(rho p)

save, replace

/* Correlation Matrix for Criticize Government */

use SudanCEM, clear
tetrachoric GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, stats(rho p)
quietly estpost correlate GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, matrix listwise
esttab using SBSudTet.tex, unstack not noobs compress replace

eststo clear

use LebCEM, clear
tetrachoric GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, stats(rho p)
quietly estpost correlate GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, matrix listwise
esttab using SBLebTet.tex, unstack not noobs compress replace

eststo clear

use SACEM, clear
tetrachoric GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, stats(rho p)
quietly estpost correlate GovPerR2 TrustGovR2 GovDoesAllR2 GovCorruption if imp==0, matrix listwise
esttab using SBSATet.tex, unstack not noobs compress replace

eststo clear


/* 2. Covariate Balance for Lebanon and Saudi Arabia (calculated when running analysis for Figure 3, manually entered into R) */

/* 3. Missingness Maps Created in R (Figure 6) */

/* Sudan Regional Balance */
use SudanCEM
graph hbar (count) id if imp==0, over(ProvinceName) by(ArabSpring) saving(SBFigure7, asis replace)
graph export SBFigure7.png, replace

/* Tables Associated with Figure 3 */
/* Sudan */

use SudanCEM

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName[aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable9.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress 

eststo clear

save, replace

/* Lebanon */

use LebCEM

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring Education lnincome Age i.ProvinceName[aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable10.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SACEM

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r

eststo Freeriding: mi estimate, post: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r

eststo GovPer: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r

eststo CurrentEcon: mi estimate, post: reg CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r

eststo FutureEcon: mi estimate, post: reg FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable11.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress


eststo clear

save, replace

/* Robustness Checks (controls) */

use SudanCEM
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Religious i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Married i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Religious Married i.ProvinceName [aweight=cem_weights], r

save, replace

use LebCEM
eststo: mi estimate, post: reg CritGov2 ArabSpring Education lnincome Age Religious i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Education lnincome Age Married i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Education lnincome Age Religious Married i.ProvinceName [aweight=cem_weights], r

save, replace

use SACEM
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Religious i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Married i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age Religious Married i.ProvinceName [aweight=cem_weights], r

esttab using SBTable12.tex, star(+ 0.10 * 0.05) ci label replace booktabs mgr("Sudan" "Lebanon" "Saudi Arabia", pattern(1 0 0 1 0 0 1 0 0)) compress 

save, replace

eststo clear

/* Robustness Check Government Satisfaction (0-9 Scale) */

use SudanCEM
eststo: mi estimate, post: reg GovSatisfaction ArabSpring Rural Female lnincome Age [aweight=cem_weights], r
use LebCEM
eststo: mi estimate, post: reg GovSatisfaction ArabSpring Rural Education lnincome Age [aweight=cem_weights], r
use SACEM
eststo: mi estimate, post: reg GovSatisfaction ArabSpring Rural Female lnincome Age [aweight=cem_weights], r

esttab using SBTable15.tex, star(+ 0.10 * 0.05) ci label replace booktabs mgr("Sudan" "Lebanon" "Saudi Arabia", pattern(1 1 1 )) compress


save, replace

/* Compare to Figure 2 */

use LebCEM

kdensity GovSatisfaction if imp==0, kernel(gaussian) nograph generate(x fx)
kdensity GovSatisfaction if ArabSpring==0 & imp==0, kernel(gaussian) nograph generate(fx0) at(x)
kdensity GovSatisfaction if ArabSpring==1 & imp==0, kernel(gaussian) nograph generate(fx1) at(x)
label var fx0 "Before Tunisian Revolution"
label var fx1 "After Tunisian Revolution"
line fx0 fx1 x, lwidth(medthick) sort ytitle("") graphregion(color(white)) bgcolor(white) saving(SBFigure2Stata, asis replace)
graph export SBFigure8.png, replace
drop fx x fx0 fx1
save, replace

use SACEM

kdensity GovSatisfaction if imp==0, kernel(gaussian) nograph generate(x fx)
kdensity GovSatisfaction if ArabSpring==0 & imp==0, kernel(gaussian) nograph generate(fx0) at(x)
kdensity GovSatisfaction if ArabSpring==1 & imp==0, kernel(gaussian) nograph generate(fx1) at(x)
label var fx0 "Before Tunisian Revolution"
label var fx1 "After Tunisian Revolution"
line fx0 fx1 x, sort ytitle(Density) saving(SBFigure9, asis replace)
graph export SBFigure9.png, replace
drop fx x fx0 fx1
save, replace


/* 4. Complete Case Analysis, no matching */

/* Sudan */

use SudanCEM
save SudanCC

drop if imp!=0
save, replace

eststo clear

eststo: reg Freeriding ArabSpring, r
eststo: reg Freeriding ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg CritGov2 ArabSpring, r
eststo: reg CritGov2 ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg CurrentEcon ArabSpring, r
eststo: reg CurrentEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg FutureEcon ArabSpring, r
eststo: reg FutureEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r

esttab using SBTable16.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Lebanon */

use LebCEM
save LebCC

drop if imp!=0
save, replace

eststo: reg Freeriding ArabSpring, r
eststo: reg Freeriding ArabSpring lnincome Age Education i.ProvinceName, r
eststo: reg CritGov2 ArabSpring, r
eststo: reg CritGov2 ArabSpring lnincome Age Education i.ProvinceName, r
eststo: reg GovCorruption ArabSpring, r
eststo: reg GovCorruption ArabSpring lnincome Age Education i.ProvinceName, r
eststo: reg TrustGov ArabSpring, r
eststo: reg TrustGov ArabSpring lnincome Age Education i.ProvinceName, r
eststo: reg CurrentEcon ArabSpring, r
eststo: reg CurrentEcon ArabSpring lnincome Age Education i.ProvinceName, r
eststo: reg FutureEcon ArabSpring, r
eststo: reg FutureEcon ArabSpring lnincome Age Education i.ProvinceName, r

esttab using SBTable17.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SACEM
save SACC

drop if imp!=0
save, replace

eststo: reg Freeriding ArabSpring, r
eststo: reg Freeriding ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg CritGov2 ArabSpring, r
eststo: reg CritGov2 ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg CurrentEcon ArabSpring, r
eststo: reg CurrentEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: reg FutureEcon ArabSpring, r
eststo: reg FutureEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r

esttab using SBTable18.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* 5. Regression Analyses with MI and without Matching */

/* Sudan */

use SudanCEM

eststo: mi est, post: reg Freeriding ArabSpring, r
eststo: mi est, post: reg Freeriding ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg CritGov2 ArabSpring, r
eststo: mi est, post: reg CritGov2 ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg CurrentEcon ArabSpring, r
eststo: mi est, post: reg CurrentEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg FutureEcon ArabSpring, r
eststo: mi est, post: reg FutureEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r

esttab using SBTable19.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Lebanon */

use LebCEM

eststo: mi est, post: reg Freeriding ArabSpring, r
eststo: mi est, post: reg Freeriding ArabSpring lnincome Age Education i.ProvinceName, r
eststo: mi est, post: reg CritGov2 ArabSpring, r
eststo: mi est, post: reg CritGov2 ArabSpring lnincome Age Education i.ProvinceName, r
eststo: mi est, post: reg CurrentEcon ArabSpring, r
eststo: mi est, post: reg CurrentEcon ArabSpring lnincome Age Education i.ProvinceName, r
eststo: mi est, post: reg FutureEcon ArabSpring, r
eststo: mi est, post: reg FutureEcon ArabSpring lnincome Age Education i.ProvinceName, r

esttab using SBTable20.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SACEM

eststo: mi est, post: reg Freeriding ArabSpring, r
eststo: mi est, post: reg Freeriding ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg CritGov2 ArabSpring, r
eststo: mi est, post: reg CritGov2 ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg TrustGov ArabSpring, r
eststo: mi est, post: reg TrustGov ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg CurrentEcon ArabSpring, r
eststo: mi est, post: reg CurrentEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r
eststo: mi est, post: reg FutureEcon ArabSpring, r
eststo: mi est, post: reg FutureEcon ArabSpring Rural lnincome Age Female i.ProvinceName, r

esttab using SBTable21.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* 6. MLE for Categorical Variables w/ <6 categories */

/* Sudan */
use SudanCEM, clear

eststo Freeriding: mi estimate, post: ologit Freeriding ArabSpring [iweight=cem_weights], r
eststo Freeriding2: mi estimate, post: ologit Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo CriticizeGovernment: mi estimate, post: ologit CritGov2 ArabSpring [iweight=cem_weights], r
eststo CriticizeGovernment2: mi estimate, post: ologit CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovPer: mi estimate, post: logit GovPerR2 ArabSpring [iweight=cem_weights], r
eststo GovPer2: mi estimate, post: logit GovPerR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring [iweight=cem_weights], r
eststo TrustGov2: mi estimate, post: logit TrustGovR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovernmentDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring [iweight=cem_weights], r
eststo GovernmentDoesAll2: mi estimate, post: logit GovDoesAllR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring [iweight=cem_weights], r
eststo Corruption2: mi estimate, post: logit GovCorruption ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo CurrentEcon: mi estimate, post: ologit CurrentEcon ArabSpring [iweight=cem_weights], r
eststo CurrentEcon2: mi estimate, post: ologit CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo FutureEcon: mi estimate, post: ologit FutureEcon ArabSpring [iweight=cem_weights], r
eststo FutureEcon2: mi estimate, post: ologit FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
esttab using SBTable22.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Lebanon */

use LebCEM, clear

eststo Freeriding: mi estimate, post: ologit Freeriding ArabSpring [iweight=cem_weights], r
eststo Freeriding2: mi estimate, post: ologit Freeriding ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo CriticizeGovernment: mi estimate, post: ologit CritGov2 ArabSpring [iweight=cem_weights], r
eststo CriticizeGovernment2: mi estimate, post: ologit CritGov2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovPer: mi estimate, post: logit GovPerR2 ArabSpring [iweight=cem_weights], r
eststo GovPer2: mi estimate, post: logit GovPerR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring [iweight=cem_weights], r
eststo TrustGov2: mi estimate, post: logit TrustGovR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovernmentDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring [iweight=cem_weights], r
eststo GovernmentDoesAll2: mi estimate, post: logit GovDoesAllR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring [iweight=cem_weights], r
eststo Corruption2: mi estimate, post: logit GovCorruption ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo CurrentEcon: mi estimate, post: ologit CurrentEcon ArabSpring [iweight=cem_weights], r
eststo CurrentEcon2: mi estimate, post: ologit CurrentEcon ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo FutureEcon: mi estimate, post: ologit FutureEcon ArabSpring [iweight=cem_weights], r
eststo FutureEcon2: mi estimate, post: ologit FutureEcon ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
esttab using SBTable23.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SACEM, clear

eststo Freeriding: mi estimate, post: ologit Freeriding ArabSpring [iweight=cem_weights], r
eststo Freeriding2: mi estimate, post: ologit Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo CriticizeGovernment: mi estimate, post: ologit CritGov2 ArabSpring [iweight=cem_weights], r
eststo CriticizeGovernment2: mi estimate, post: ologit CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
/* eststo GovPer: mi estimate, post: logit GovPer ArabSpring [iweight=cem_weights], r
eststo GovPer: mi estimate, post: logit GovPer ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r */
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring [iweight=cem_weights], r
eststo TrustGov2: mi estimate, post: logit TrustGovR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring [iweight=cem_weights], r
eststo GovDoesAll2: mi estimate, post: logit GovDoesAllR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring [iweight=cem_weights], r
/* Rural excluded below due to issues running model */
eststo Corruption2: mi estimate, post: logit GovCorruption ArabSpring Female lnincome Age [iweight=cem_weights], r
eststo CurrentEcon: mi estimate, post: ologit CurrentEcon ArabSpring [iweight=cem_weights], r
eststo CurrentEcon2: mi estimate, post: ologit CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo FutureEcon: mi estimate, post: ologit FutureEcon ArabSpring [iweight=cem_weights], r
eststo FutureEcon2: mi estimate, post: ologit FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
esttab using SBTable24.tex, star(+ 0.10 * 0.05) ci addnote("Government Performance was excluded, 0 observations in the treatment group for the complete case analysis") label replace booktabs compress

eststo clear

// Possible Table 3 in text

use SudanCEM, clear

eststo GovPer: mi estimate, post: logit GovPerR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r

use LebCEM, clear

eststo GovPer: mi estimate, post: logit GovPerR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo GovDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring Education lnincome Age i.ProvinceName [iweight=cem_weights], r

use SACEM, clear

eststo GovPer: mi estimate, post: logit GovPerR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo TrustGov: mi estimate, post: logit TrustGovR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r
eststo Corruption: mi estimate, post: logit GovCorruption ArabSpring Female lnincome Age [iweight=cem_weights], r
eststo GovDoesAll: mi estimate, post: logit GovDoesAllR2 ArabSpring Rural Female lnincome Age i.ProvinceName [iweight=cem_weights], r

esttab using LogitTable3.tex, star(+ 0.10 * 0.05) ci label replace booktabs mgr("Sudan" "Lebanon" "Saudi Arabia", pattern(1 0 0 0 1 0 0 0 1 0 0 0)) compress 

eststo clear


save, replace


/* 7. Automated Coarsening */

/* Sudan */

use SUForPub, clear

gen GovPerR2 = -1*GovPer + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption
mi register passive CritGov2 GovPerR2 TrustGovR2 GovDoesAllR2 

cem Rural lnincome Age Female, tr(ArabSpring) impvar(imp)

save Sudan2CEM, replace

eststo: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable25.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Lebanon */

use LForPub

gen GovPerR2 = -1*GovPerLeb + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption
mi register passive CritGov2 GovPerR2 TrustGovR2 GovDoesAllR2 

cem Rural lnincome Age Education, tr(ArabSpring) impvar(imp)

save Leb2CEM

eststo: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg Freeriding ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable26.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SAForPub

gen GovPerR2 = -1*GovPer + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption
mi register passive CritGov2 GovPerR2 TrustGovR2 GovDoesAllR2 

cem Rural lnincome Age Female, tr(ArabSpring) impvar(imp)

save SA2CEM

eststo: mi estimate, post: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CurrentEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg FutureEcon ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg DemocraticSupport ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable27.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Matching on Missingness */
/* Sudan */

use SUForPub, clear
drop if imp != 0

gen GovPerR2 = -1*GovPer + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption

cem Rural lnincome Age Female, tr(ArabSpring)

save SUMissing, replace

eststo: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring  [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring  Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring  Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable28.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Lebanon */

use LForPub
save LMissing

drop if imp != 0

gen GovPerR2 = -1*GovPerLeb + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption

cem Rural lnincome Age Education, tr(ArabSpring)

save, replace

eststo: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: reg Freeriding ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring  [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring Education lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable29.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

save, replace

/* Saudi Arabia */

use SAForPub, clear
save SAMissing

drop if imp != 0

gen GovPerR2 = -1*GovPer + 1
gen TrustGovR2 = -1*TrustGov + 1
gen GovDoesAllR2 = -1*GovDoesAllItCan + 1
gen CritGov2= GovPerR2 + TrustGovR2 + GovDoesAllR2 + GovCorruption

cem Rural lnincome Age Female, tr(ArabSpring)

save, replace

eststo: reg Freeriding ArabSpring [aweight=cem_weights], r
eststo: reg Freeriding ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring [aweight=cem_weights], r
eststo: reg CritGov2 ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring  [aweight=cem_weights], r
eststo: reg CurrentEcon ArabSpring  Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring [aweight=cem_weights], r
eststo: reg FutureEcon ArabSpring  Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r

esttab using SBTable30.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear

/* Missing Values Coded as Positive Evalations of Government */

use SudanCEM, clear

gen GovPerR3 = 1 if GovPer==0 & imp==0
replace GovPerR3 = 0 if GovPer!=0 & imp==0
gen TrustGovR3 = 1 if TrustGov==0 & imp==0
replace TrustGovR3 = 0 if TrustGov!=0 & imp==0
gen GovDoesAllR3 = 1 if  GovDoesAllItCan==0 & imp==0
replace GovDoesAllR3 = 0 if  GovDoesAllItCan!=0 & imp==0
gen GovCorrMiss0= 1 if GovCorruption==1 & imp==0
replace GovCorrMiss0= 0 if GovCorruption!=1 & imp==0
gen CritGov3= GovPerR3 + TrustGovR3 + GovDoesAllR3 + GovCorrMiss0
mi register regular CritGov3 GovPerR3 TrustGovR3 GovDoesAllR3 GovCorrMiss0

eststo: mi estimate, post: reg CritGov3 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov3 ArabSpring Rural Female lnincome Age i.ProvinceName[aweight=cem_weights], r


save, replace

use LebCEM, clear

gen GovPerR3 = 1 if GovPerLeb==0 & imp==0
replace GovPerR3 = 0 if GovPerLeb!=0 & imp==0
gen TrustGovR3 = 1 if TrustGov==0 & imp==0
replace TrustGovR3 = 0 if TrustGov!=0 & imp==0
gen GovDoesAllR3 = 1 if  GovDoesAllItCan==0 & imp==0
replace GovDoesAllR3 = 0 if  GovDoesAllItCan!=0 & imp==0
gen GovCorrMiss0= 1 if GovCorruption==1 & imp==0
replace GovCorrMiss0= 0 if GovCorruption!=1 & imp==0
gen CritGov3= GovPerR3 + TrustGovR3 + GovDoesAllR3 + GovCorrMiss0
mi register regular CritGov3 GovPerR3 TrustGovR3 GovDoesAllR3 GovCorrMiss0

eststo: mi estimate, post: reg CritGov3 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov3 ArabSpring Rural Education lnincome Age i.ProvinceName[aweight=cem_weights], r

save, replace

use SACEM, clear

gen GovPerR3 = 1 if GovPer==0 & imp==0
replace GovPerR3 = 0 if GovPer!=0 & imp==0
gen TrustGovR3 = 1 if TrustGov==0 & imp==0
replace TrustGovR3 = 0 if TrustGov!=0 & imp==0
gen GovDoesAllR3 = 1 if  GovDoesAllItCan==0 & imp==0
replace GovDoesAllR3 = 0 if  GovDoesAllItCan!=0 & imp==0
gen GovCorrMiss0= 1 if GovCorruption==1 & imp==0
replace GovCorrMiss0= 0 if GovCorruption!=1 & imp==0
gen CritGov3= GovPerR3 + TrustGovR3 + GovDoesAllR3 + GovCorrMiss0
mi register regular CritGov3 GovPerR3 TrustGovR3 GovDoesAllR3 GovCorrMiss0

eststo: mi estimate, post: reg CritGov3 ArabSpring [aweight=cem_weights], r
eststo: mi estimate, post: reg CritGov3 ArabSpring Rural Female lnincome Age i.ProvinceName[aweight=cem_weights], r

esttab using SBTable36.tex, star(+ 0.10 * 0.05) ci label replace booktabs mgr("Sudan" "Lebanon" "Saudi Arabia", pattern(1 0 1 0 1 0)) compress 

eststo clear

save, replace


/* Additional Analysis of Mediation

Current Belief Regarding Economic Performance As additional mediator */

mi estimate (ind_eff_ce: [CurrentEcon]_b[ArabSpring]*[CritGov2]_b[CurrentEcon]) (ind_eff_fr: [Freeriding]_b[ArabSpring]*[CritGov2]_b[Freeriding]) (tot_eff_as: [CurrentEcon]_b[ArabSpring]*[CritGov2]_b[CurrentEcon] + [Freeriding]_b[ArabSpring]*[CritGov2]_b[Freeriding] + [CritGov2]_b[ArabSpring]), cmdok: sureg (CurrentEcon ArabSpring)(Freeriding ArabSpring)(CritGov2 CurrentEcon Freeriding ArabSpring Rural lnincome Female Age i.ProvinceName) [aweight=cem_weights]

mi estimate (ind_eff_fr: [Freeriding]_b[ArabSpring]*[CritGov2]_b[Freeriding] + [Freeriding]_b[ArabSpring]*[CurrentEcon]_b[Freeriding]*[CritGov2]_b[CurrentEcon]) (ind_eff_ce: [CurrentEcon]_b[ArabSpring]*[CritGov2]_b[CurrentEcon] - [Freeriding]_b[ArabSpring]*[CurrentEcon]_b[Freeriding]*[CritGov2]_b[CurrentEcon])  (tot_eff_as: [CurrentEcon]_b[ArabSpring]*[CritGov2]_b[CurrentEcon] + [Freeriding]_b[ArabSpring]*[CritGov2]_b[Freeriding] + [CritGov2]_b[ArabSpring]), cmdok: sureg (CurrentEcon Freeriding ArabSpring)(Freeriding ArabSpring)(CritGov2 CurrentEcon Freeriding ArabSpring Rural lnincome Female Age i.ProvinceName) [aweight=cem_weights]

save, replace

/* Analysis of Subgroups by Preference for Gradual vs. Revolutionary Change */

use SudanCEM

ttest  PoliticalReformStages if imp==0, by(ArabSpring)
tab PoliticalReformStages ArabSpring if imp==0, chi2

eststo clear

use SUMissing, clear

eststo: reg PoliticalReformStages ArabSpring Rural Female lnincome Age i.ProvinceName [aweight=cem_weights], r
esttab using SBTable35.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo FreeridingI: reg Freeriding ArabSpring Rural Female Age [aweight=cem_weights] if PoliticalReformStages==0, r

eststo CritGovI: reg CritGov2 ArabSpring Rural Female Age [aweight=cem_weights] if PoliticalReformStages==0, r

eststo FreeridingG: reg Freeriding ArabSpring Rural Female Age [aweight=cem_weights] if PoliticalReformStages==1, r

eststo CritGovG: reg CritGov2 ArabSpring Rural Female Age [aweight=cem_weights] if PoliticalReformStages==1, r

coefplot (FreeridingI, lab(Social Capital)) (CritGovI, lab(Criticize Government)), bylabel(Immediate Reform) || (FreeridingG, lab(Social Capital)) (CritGovG, lab(Criticize Government)), bylabel(Gradual Reform) ||, keep(ArabSpring) mlabel yline(0) ylabel(#3) vert format(%9.3g) coeflabels(ArabSpring = "    ", notick ) bgcolor(white) graphregion(color(white)) saving(SBFigure5, asis replace)
graph export SBFigure5.png, replace

esttab using SBTable32.tex, star(+ 0.10 * 0.05) ci label replace booktabs compress

eststo clear
